//
//  BaseViewController.m
//  WeightMaster
//
//  Created by maoyu on 15/8/21.
//  Copyright (c) 2015年 buddysoft. All rights reserved.
//

#import "BaseViewController.h"
#import "BDFoundation.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createBackLayer];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (void)createBackLayer {
//    UIBezierPath * path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(10, 20, 30, 30) cornerRadius:5.0];
//    CAShapeLayer * layer = [[CAShapeLayer alloc] init];
//    layer.path = [path CGPath];
//    layer.fillColor = [RGB(0xf9, 0xf9, 0xf9) CGColor];
//    [self.view.layer addSublayer:layer];
    
    UIButton * button = [[UIButton alloc] initWithFrame:CGRectMake(16, 25, 25, 25)];
    [button setBackgroundImage:[UIImage imageNamed:@"back_button"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
    button = [[UIButton alloc] initWithFrame:CGRectMake(0, 10, 70, 70)];
    [button addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
//    path = [UIBezierPath bezierPath];
//    [path moveToPoint:CGPointMake(27, 25)];
//    [path addLineToPoint:CGPointMake(17,35)];
//    [path addLineToPoint:CGPointMake(27,45)];
//    path.lineWidth = 2.0;
//    
//    layer = [[CAShapeLayer alloc] init];
//    layer.path = [path CGPath];
//    layer.strokeColor = [RGB(0xf9, 0xf9, 0xf9) CGColor];
//    layer.fillColor = [[UIColor clearColor] CGColor];
//    [self.view.layer addSublayer:layer];
}

- (void)back {
    [self.navigationController popViewControllerAnimated:YES];
}

@end
